<?php
echo $this->navegacion($this->nav);

$domConfig = Zend_Registry::get('domConfig');
$perfil = App_Perfil::getInstance();
$perfil->cargar("ADMIN_AUTO1");
if ($perfil->crear()){
?>
<BR>
<div align="right" class="buttons">
  <a class="btn btn-primary" href="<?php echo $this->baseUrl("/autoevaluacion/cronogramageneral/crearcronogramagnral");?>">
  <span class="glyphicon glyphicon-plus-sign"></span> Crear Cronograma</a>
</div>

<?php }

if(count($this->datos)>0):?>
<table id="table_id" align="center" class="display">
  <thead>
    <tr>
      <th width="10%">Codigo</th>
      <th width="30%">Nombre</th>
      <th width="20%">A&ntilde;o</th>
      <th width="25%">Observaci&oacute;n</th>
      <th width="15%">Acciones</th>
    </tr>
  </thead>
  <tbody>
	<?php
	    foreach ($this->datos as $key => $value):
	        $params=App_Util_SafeUrl::encriptar(array("codcronograma"=>$value["codcronograma"]),true);
	?>
    <tr>
      <td><?php echo $value["codcronograma"];?></td>
      <td><?php echo "<a href=\"{$this->baseUrl("/autoevaluacion/cronogramageneral/ingresar/{$params}")}\" title=\"Ingresar\">{$value["nombrecronograma"]}";?></a></td>
      <td><?php echo "{$value["ano"]}" ;?></td>
      <td><?php echo "{$value["observaciongnral"]}" ;?></td>
      <td>
        <?php
        $tools = new App_Util_ToolButton();
        $tools->addEdit($this->baseUrl("/autoevaluacion/cronogramageneral/crearcronogramagnral/{$params}"),$perfil->modificar());
        $tools->addDelete($this->baseUrl("/autoevaluacion/cronogramageneral/eliminarcronogramagnral/{$params}"),$perfil->eliminar());
        echo $tools->render();
   		?>
      </td>
    </tr>
  <?php  endforeach;?>
  </tbody>
</table>

<script type="text/javascript">
 $(function() {
	$('#table_id').dataTable({
		"bJQueryUI": true,
		"bAutoWidth": false,
 		"sPaginationType": "full_numbers",
 		"bStateSave": true,
 		"aoColumns": [
 	 		 			{ "sType": "numeric" },
 	 		 			null,
 	 		 			null,
 	 		 			null,
 	 		 			{ "bSortable": false, "bSearchable": false }
 	 		 		 ]
 	 		  		
	});
});
</script>
<?php else:?>
<br/>
<?php echo $this->mensajes("No existen registros");?>
<?php endif;?>
